home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>LSet Statement [Runtime]</title><meta name="filename" content="text/sbasic/common/03120304"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:paragraphinfo state="E" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="lset" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="LSet; statement" tag="kw66409_1"/><help:link Id="66409">LSet Statement [Runtime]</help:link></p> <p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Aligns a string to the left of a string variable, or copies a variable of a user-defined type to another variable of a different user-defined type.</p> <help:paragraphinfo state="E"/></help:to-be-embedded> <p class="Head2"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>Syntax:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>LSet Var As String = Text or LSet Var1 = Var2</p> <p class="Head2"><help:paragraphinfo state="U" number="5" xmlns:help="http://openoffice.org/2000/help"/>Parameters:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Var:</span> Any String variable that contains the string that you want align to the left.</p> <p class="Paragraph"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Text:</span> String that you want to align to the left of the string variable.</p> <p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Var1:</span> Name of the user-defined type variable that you want to copy to.</p> <p class="Paragraph"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Var2:</span> Name of the user-defined type variable that you want to copy from.</p> <p class="Paragraph"><help:paragraphinfo state="U" number="10" xmlns:help="http://openoffice.org/2000/help"/>If the string is shorter than the string variable, <span class="T1">LSet</span> left-aligns the string within the string variable. Any remaining positions in the string variable are replaced by spaces. If the string is longer than the string variable, only the leftmost characters up to the length of the string variable are copied. With the <span class="T1">LSet</span> statement, you can also copy a user-defined type variable to another variable of the same type.</p> <p class="Head2"><help:paragraphinfo state="U" number="11" xmlns:help="http://openoffice.org/2000/help"/>Example:</p> <p class="PropText"><help:paragraphinfo state="U" number="12" xmlns:help="http://openoffice.org/2000/help"/>Sub ExampleRLSet</p> <p class="PropText"><help:paragraphinfo state="U" number="13" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>Dim sVar As String</p> <p class="PropText"><help:paragraphinfo state="U" number="14" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>Dim sExpr As String</p> <p class="PropText"><help:paragraphinfo state="U" number="15" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/></p> <p class="PropText"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sVar = String(40,"*")</p> <p class="PropText"><help:paragraphinfo state="U" number="17" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sExpr = "SBX"</p> <p class="PropText"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>REM <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Align "SBX" within the 40-character reference string</p> <p class="PropText"><help:paragraphinfo state="U" number="19" xmlns:help="http://openoffice.org/2000/help"/>REM <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Replace asterisks with spaces</p> <p class="PropText"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>RSet sVar = sExpr</p> <p class="PropText"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>Print ">"; sVar; "<"</p> <p class="PropText"><help:paragraphinfo state="U" number="22" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="PropText"><help:paragraphinfo state="U" number="23" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sVar = String(5,"*")</p> <p class="PropText"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sExpr = "123457896"</p> <p class="PropText"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>RSet sVar = sExpr</p> <p class="PropText"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>Print ">"; sVar; "<"</p> <p class="PropText"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/></p> <p class="PropText"><help:paragraphinfo state="U" number="28" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sVar = String(40,"*")</p> <p class="PropText"><help:paragraphinfo state="U" number="29" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sExpr = "SBX"</p> <p class="PropText"><help:paragraphinfo state="U" number="30" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>REM Left-align "SBX" within the 40-character reference string</p> <p class="PropText"><help:paragraphinfo state="U" number="31" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>LSet sVar = sExpr</p> <p class="PropText"><help:paragraphinfo state="U" number="32" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>Print ">"; sVar; "<"</p> <p class="PropText"><help:paragraphinfo state="U" number="33" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="PropText"><help:paragraphinfo state="U" number="34" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sVar = String(5,"*")</p> <p class="PropText"><help:paragraphinfo state="U" number="35" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>sExpr = "123456789"</p> <p class="PropText"><help:paragraphinfo state="U" number="36" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>LSet sVar = sExpr</p> <p class="PropText"><help:paragraphinfo state="U" number="37" xmlns:help="http://openoffice.org/2000/help"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/>Print ">"; sVar; "<"<text:tab-stop xmlns:text="http://openoffice.org/2000/text"/><text:tab-stop xmlns:text="http://openoffice.org/2000/text"/></p> <p class="PropText"><help:paragraphinfo state="U" number="38" xmlns:help="http://openoffice.org/2000/help"/>End Sub</p> </body></html>